<#setting number_format="#">
<#-- 赋值path变量-->
<#assign path><#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if></#assign>
<#assign model><#if package.ModuleName?? && package.ModuleName != "">${package.ModuleName}</#if><#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if></#assign>
<#assign genNewId1>${genId+1}</#assign>
<#assign genNewId2>${genId+2}</#assign>
<#assign genNewId3>${genId+3}</#assign>
<#assign genNewId4>${genId+4}</#assign>
<#assign genNewId5>${genId+5}</#assign>


-- 目录 SQL
insert into sys_resource(
id,parent_id,parent_ids,title,type,permission,
route_path,component_name,component_path,
res_status,res_sort,menu_ext_flag,menu_cache_flag,menu_hidden_flag,
menu_icon,create_date)
values('${genNewId1}',0,0,'${table.comment!}目录',1,null,
'${path}',null,null,
'0','100','2','2','1',
'nested','${datetime}'
);


-- 菜单 SQL
insert into sys_resource(
id,parent_id,parent_ids,title,type,permission,
route_path,component_name,component_path,
res_status,res_sort,menu_ext_flag,menu_cache_flag,menu_hidden_flag,
menu_icon,create_date)
values('${genNewId2}','${genNewId1}','0,${genNewId1}','${table.comment!}菜单',2,'${model}:list',
'${model}-manage','${model}-manage','${model}/${model}-manage',
'0','101','2','2','1',
'nested','${datetime}'
);


-- 按钮 SQL
insert into sys_resource(
id,parent_id,parent_ids,title,type,permission,
route_path,component_name,component_path,
res_status,res_sort,menu_ext_flag,menu_cache_flag,menu_hidden_flag,
menu_icon,create_date)
values('${genNewId3}','${genNewId2}','0,${genNewId1},${genNewId2}','${table.comment!}添加',3,'${model}:save',
null,null,null,
'0','101.02','2','2','1',
'nested','${datetime}'
);

insert into sys_resource(
id,parent_id,parent_ids,title,type,permission,
route_path,component_name,component_path,
res_status,res_sort,menu_ext_flag,menu_cache_flag,menu_hidden_flag,
menu_icon,create_date)
values('${genNewId4}','${genNewId2}','0,${genNewId1},${genNewId2}','${table.comment!}修改',3,'${model}:update',
null,null,null,
'0','101.06','2','2','1',
'nested','${datetime}'
);

insert into sys_resource(
id,parent_id,parent_ids,title,type,permission,
route_path,component_name,component_path,
res_status,res_sort,menu_ext_flag,menu_cache_flag,menu_hidden_flag,
menu_icon,create_date)
values('${genNewId5}','${genNewId2}','0,${genNewId1},${genNewId2}','${table.comment!}删除',3,'${model}:delete',
null,null,null,
'0','101.10','2','2','1',
'nested','${datetime}'
);
